/**
 * Copyright (c) 2016-2019 ykf All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.basic.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.basic.common.annotation.DictParam;
import com.basic.common.validator.group.AddGroup;
import com.basic.common.validator.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 系统用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@Data
@TableName("sys_user")
public class SysUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 用户ID
	 */
	@TableId
	private Long userId;

	/**
	 * 用户名
	 */
//	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String username;

	/**
	 * 姓名
	 */
	@NotBlank(message="姓名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String name;

	/**
	 * 密码
	 */
//	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	private String password;

	/**
	 * 盐
	 */
	private String salt;

	/**
	 * 入职日期
	 */
	@NotNull(message="入职日期不能为空", groups = AddGroup.class)
	@JsonFormat(pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date entryDate;

	/**
	 * 花名
	 */
	@NotBlank(message="花名不能为空", groups = AddGroup.class)
	private String flowerName;

	/**
	 * 性别 男/女
	 */
	@NotBlank(message="性别不能为空", groups = AddGroup.class)
	private String sex;

	/**
	 * 工号
	 */
	@NotBlank(message="工号不能为空", groups = AddGroup.class)
	private String no;

	/**
	 * 部门
	 */
	@NotBlank(message="部门不能为空", groups = AddGroup.class)
	private String deptNo;

	/**
	 * 部门名称
	 */
	@DictParam(field = "deptNo", targetField = "deptName", dictType = "department")
	private String deptName;

	/**
	 * 岗位
	 */
	@NotBlank(message="岗位不能为空", groups = AddGroup.class)
	private String postNo;

	/**
	 * 岗位名称
	 */
	@DictParam(field = "postNo", targetField = "pestName", dictType = "post")
	private String pestName;

	/**
	 * 在职状态 1-在职 0-离职
	 */
	@NotNull(message="在职状态不能为空", groups = AddGroup.class)
	private Integer onDutyStatus;

	/**
	 * 是否已发送离职短信 0-未发送 1-已发送
	 */
	private Integer sendDepartMsg;

	/**
	 * 转正状态 0-试用期 1-已转正
	 */
	@NotNull(message="转正状态不能为空", groups = AddGroup.class)
	private Integer becomeRegularStatus;

	/**
	 * 转正时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date becomeRegulardDate;

	/**
	 * 公司
	 */
	@NotBlank(message="公司不能为空", groups = AddGroup.class)
	private String companyNo;

	/**
	 * 公司名称
	 */
	@DictParam(field = "companyNo", targetField = "companyName", dictType = "company")
	private String companyName;


//	/**
//	 * 邮箱
//	 */
//	@NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
//	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
//	private String email;

	/**
	 * 手机号
	 */
	@NotBlank(message="手机号不能为空", groups = AddGroup.class)
	private String mobile;

	/**
	 * 状态  0：禁用   1：正常
	 */
	private Integer status;

	/**
	 * 角色ID列表
	 */
	@TableField(exist=false)
	private List<Long> roleIdList;

	/**
	 * 创建者ID
	 */
	@TableField(fill = FieldFill.INSERT)
	private Long createUserId;
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;

	/**
	 * 查询条件
	 */
	@TableField(exist = false)
	private String keyword;

	/**
	 * 编组
	 */
	private String groupNo;

	/**
	 * 黑/白 名单
	 */
	private String listName;

	/**
	 * 岗位分类
	 */
	private String customPostType;

	/**
	 * 岗位分类名称
	 */
	@DictParam(field = "customPostType", targetField = "customPostTypeName", dictType = "customPostType")
	private String customPostTypeName;

	/**
	 * 客服分组
	 */
	private String customGroup;

	/**
	 * 客服分组名称
	 */
	@DictParam(field = "customGroup", targetField = "customGroupName", dictType = "customGroup")
	private String customGroupName;

	/**
	 * 办公室地点
	 */
	private String officeLocation;

	/**
	 * 电话
	 */
	private String tel;

	/**
	 * 旧数据id
	 */
	private String oldId;

	@TableField(exist = false)
	private Long shopId;

	/**
	 * 当前店铺类别店铺数量
	 */
	@TableField(exist = false)
	private String shopTypeCount;
	/**
	 * 正在服务的店铺数量
	 */
	@TableField(exist = false)
	private String serverShopCount;
	/**
	 * 当月提成
	 */
	@TableField(exist = false)
	private String commissionSalary;

}
